<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<script type="text/javascript">

var intTextBox=1;
function addElement()
{
intTextBox = intTextBox + 1;
var contentID = document.getElementById('a1');
var newTBDiv = document.createElement('tr');
newTBDiv.setAttribute('id','strText'+intTextBox);
newTBDiv.innerHTML = "<tr><td><input type='text' name='"+intTextBox+"a' /></td><td><input type='text' name='"+intTextBox+"b' /></td><td><input type='text' name='"+intTextBox+"c' /></td><td><input type='text' name='"+intTextBox+"d' /></td><td><input type='text' name='"+intTextBox+"e' /></td></tr>";
contentID.appendChild(newTBDiv);
}
function removeElement()
{
if(intTextBox != 0)
{
var contentID = document.getElementById('a1');
contentID.removeChild(document.getElementById('strText'+intTextBox));
intTextBox = intTextBox-1;
}
}

</script>
</head>

<body>
<form>
<p><a href="javascript:addElement();" >Add</a> <a href="javascript:removeElement();" >Remove</a></p>
<table id="a1">
<tr>
<th>Product no.</th>
<th>Sub Product</th>
<th>Quantity</th>
<th>Weight</th>
<th>Remark</th>
</tr>
<tr>
<td><input type="text" name="1a" value="1"/></td>
<td><input type="text" name="1b" value="1"/></td>
<td><input type="text" name="1c" value="1"/></td>
<td><input type="text" name="1d" value="1"/></td>
<td><input type="text" name="1e" value="1"/></td>
</tr>



</table>
</form>
</body>
</html>
